package com.jinzecloud.blog.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jinzecloud.blog.bean.Tag;
import com.jinzecloud.blog.mapper.TagMapper;
import com.jinzecloud.blog.service.TagService;
import com.jinzecloud.blog.utils.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements TagService {

    @Autowired
    TagMapper tagMapper;

    @Override
    public void add(Tag tag) {
        tagMapper.add(tag);
    }

    @Override
    public void update(Tag tag) {
        tagMapper.update(tag);
    }

    @Override
    public void delete(Integer[] ids) {
        tagMapper.delete(ids);
    }

    @Override
    public Tag getByTagId(Integer id) {
        return tagMapper.getByTagId(id);
    }

    @Override
    public Page<Tag> getByIdAll() {
        List<Tag> all = tagMapper.getByIdAll();
        Page<Tag> page = new Page<>(all,0,0,0);
        return page;
    }
}
